create  table jms_dm.dm_network_taking_union_sign_hour_sum_dt
(
agent_code    varchar(100) COMMENT '代理区' ,
fran_code     varchar(100) COMMENT '加盟商' ,
network_code    varchar(100) COMMENT '网点code' ,
type1           varchar(100) COMMENT '类型一 包含揽收、时效签收、实际签收' ,
manage_code   varchar(100) COMMENT '管理大区' ,
manage_name   varchar(100) COMMENT '管理大区名字' ,
agent_name    varchar(100) COMMENT '代理区名字' ,
fran_name     varchar(100) COMMENT '加盟商名字' ,
network_name    varchar(100) COMMENT '网点名字' ,
scan_sum        int(11) COMMENT '当时汇总' ,
type2           varchar(100) COMMENT '类型2' ,
sum_hour_00     int(6) COMMENT '0点到1点量' ,
sum_hour_01     int(6) COMMENT '1点到2点量' ,
sum_hour_02     int(6) COMMENT '2点到3点量' ,
sum_hour_03     int(6) COMMENT '3点到4点量' ,
sum_hour_04     int(6) COMMENT '4点到5点量' ,
sum_hour_05     int(6) COMMENT '5点到6点量' ,
sum_hour_06     int(6) COMMENT '6点到7点量' ,
sum_hour_07     int(6) COMMENT '7点到8点量' ,
sum_hour_08     int(6) COMMENT '8点到9点量' ,
sum_hour_09     int(6) COMMENT '9点到10点量' ,
sum_hour_10     int(6) COMMENT '10点到11点量' ,
sum_hour_11     int(6) COMMENT '11点到12点量' ,
sum_hour_12     int(6) COMMENT '12点到13点量' ,
sum_hour_13     int(6) COMMENT '13点到14点量' ,
sum_hour_14     int(6) COMMENT '14点到15点量' ,
sum_hour_15     int(6) COMMENT '15点到16点量' ,
sum_hour_16     int(6) COMMENT '16点到17点量' ,
sum_hour_17     int(6) COMMENT '17点到18点量' ,
sum_hour_18     int(6) COMMENT '18点到19点量' ,
sum_hour_19     int(6) COMMENT '19点到20点量' ,
sum_hour_20     int(6) COMMENT '20点到21点量' ,
sum_hour_21     int(6) COMMENT '21点到22点量' ,
sum_hour_22     int(6) COMMENT '22点到23点量' ,
sum_hour_23     int(6) COMMENT '23点到24点量' ,
date_time  date COMMENT '业务日期' )
ENGINE=OLAP
DUPLICATE KEY(agent_code,fran_code,network_code,type1)
comment '揽签分布汇总表'
PARTITION BY RANGE (date_time) (
   START ("2022-11-25") END ("2023-01-24") EVERY (INTERVAL 1 day))DISTRIBUTED BY HASH(network_code) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);

alter table jms_dm.dm_network_taking_union_sign_hour_sum_dt add column (
   ordersource_code  varchar(100) comment '订单来源code'
  ,ordersource_name  varchar(100) comment '订单来源'
    )  ;